function mySetInterval(fn, millisec) {
  function interval() {
    setTimeout(interval, millisec);
    fn();
  }
  setTimeout(interval, millisec)
}



function mySetInterval(fn, millisec, count) {
  function interval() {
    if (typeof count === "undefined" || count-- > 0) {
      setTimeout(interval, millisec);
      try {
        fn()
      } catch (e) {
        count = 0;
        throw e.toString();
      }
    }
  }
  setTimeout(interval, millisec)
}